﻿@{
    Layout = null;
}
@using CNKI.TPI.Web.Search.Model;
@using CNKI.TPI.Web.Base
<script>
    function searchFolder() {
        $('#pageIndexNow').val(1);
        copySearchCondition()
        searchFolderData()
    }
    $(function () {
        searchFolder();
    })
    function searchFolderData() {
        $.ajax({
            type: "GET",
            url: timestamp("@Html.Raw(Url.Action("FavFolderResult", "UserCenter"))"),
            data: { "catid": $('#hiddenFavcateid').val(), "dbname": $('#hiddenDbName').val(), "title": $('#hiddenTitle').val(), "startDate": $('#hiddenStartdate').val(), "endDate": $('#hiddenEnddate').val(), "pageIndexNow": $('#pageIndexNow').val() },
            beforeSend: function () { $("#loading").show(); },
            success: function (msg) {
                $("#docSearchFolder").html("");
                $("#docSearchFolder").html(msg);
                $("#loading").hide();
            },
            error: function (e)
            { $("#loading").hide(); }
        })
    }
    //点击分页
    function searchPageNew(n) {
        $('#pageIndexNow').val(n);
        searchFolderData();
    }

    function copySearchCondition() {
        $('#hiddenDbName').val($('#dbname').val());
        $('#hiddenStartdate').val($('#startdate').val());
        $('#hiddenTitle').val($('#title').val());
        $('#hiddenEnddate').val($('#enddate').val());
        $('#hiddenFavcateid').val($('#favcateid').val());
    }

    $(document).keydown(function (event) {
        if (event.keyCode == 13) {
            $('#pageIndexNow').val(1);
            copySearchCondition()
            searchFolder();
        }
    });
</script>
<div class="wrapR-h" style="padding-top: 20px; padding-bottom: 20px">
    <input type="hidden" id="pageIndexNow" name="pageIndexNow" value="1" />
    <div class="form form-h">
        <label class="f-label">收藏分类：</label>

        <select class="f-text span3" id="favcateid">
            <option value="0">全部</option>
            @if (@ViewBag.FavCateList != null && @ViewBag.FavCateList.Rows.Count > 0)
            {
                foreach (System.Data.DataRow dr in ViewBag.FavCateList.Rows)
                {
                    <option value="@dr["FavoriteCategoryID"]">@dr["CategoryName"]</option>
                }
            }

        </select>
        <label class="f-label">数据库名称：</label>
        <input type="text" class="f-text span3" id="dbname" maxlength="64">
        <label class="f-label">篇名：</label>
        <input type="text" class="f-text span3" id="title" maxlength="64">
    </div>
    <br />
    <div>
        <label class="f-label">收藏时间：</label>
        @{
            string startd = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
        }
        <input type="text" class="f-text span3" id="startdate" readonly="true" value="@startd" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'enddate\')}',dateFmt:'yyyy-MM-dd' })">
        至
        @{
            string ed = System.DateTime.Now.ToString("yyyy-MM-dd");
        }
        <input type="text" class="f-text span3" id="enddate" readonly="true" value="@ed" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startdate\')}',dateFmt:'yyyy-MM-dd' })">
        <a class="btn btn-submit btn-warn-f" onclick="searchFolder()">检索</a>
        <input type="hidden" name="hiddenDbName" id="hiddenDbName" value="" />
        <input type="hidden" name="hiddenStartdate" id="hiddenStartdate" value="" />
        <input type="hidden" name="hiddenTitle" id="hiddenTitle" value="" />
        <input type="hidden" name="hiddenEnddate" id="hiddenEnddate" value="" />
        <input type="hidden" name="hiddenFavcateid" id="hiddenFavcateid" value="" />
    </div>
</div>
<div class="wrapR-c">
    <div id="docSearchFolder">
    </div>
</div>

<!--talkDiv弹出层(不带图片，宽550)-->
<!--透明背景-->
<div class="talkDivBg" style="display: none;">
    <div class="talkDiv talkDivTr talkW-550 form-h floderform" style='margin-top: -278px; display: none'>
        <div class="talkDiv-title">
            <span>修改所属分类</span>
            <a class="icon icon-close" title="关闭" onclick="hidecate()" href="javascript:void(0);"><i class="iconfont icon-error3"></i></a>
        </div>
        <div class="talkDiv-body talkDiv-body1">
            <ul class="ulfield">
            </ul>
        </div>
        <div class="f-gp">
            <div class="f-lb">
                <label class="f-label"></label>
            </div>
            <div class="f-ct" style="margin-left: 150px">
                <a href="javascript:void(0);" class="btn btn-m btn-prim-f btn-submit" onclick="savecate()">保存</a>
                &#12288;<a href="javascript:void(0);" class="btn btn-m btn-submit btn-defa-f" onclick="hidecate()">取消</a>
            </div>
        </div>
    </div>
</div>


